Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions for Validating Composite Part Assemblies Plus Tests #117

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

nroehner
Copy link
Member

Primary function validate_composite_part_assemblies returns true if the input composite part was generated only by assemblies that are valid according to SEP 055. This is a partial implementation of the best practices in SEP 055 and partially resolves #73

sbol_utilities/build_planning.py Outdated Show resolved Hide resolved
sbol_utilities/build_planning.py Outdated Show resolved Hide resolved
sbol_utilities/build_planning.py Show resolved Hide resolved
sbol_utilities/build_planning.py Outdated Show resolved Hide resolved

i = i + 1

return has_insert and has_backbone
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also check location/constraints.


invalid_assemblies = [a for a in activities if is_assembly(a) and not validate_assembly(a, c)]

return len(invalid_assemblies) == 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be done more efficiently by applying any to a generator.

@@ -8,6 +8,14 @@
from sbol_utilities.workarounds import get_parent


def get_subcomponents(c: sbol3.Component) -> List[sbol3.SubComponent]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing docstrings

class TestBuildPlanning(unittest.TestCase):

def test_validate_composite_part_assemblies(self):
test_doc = sbol3.Document()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing docstrings


sbol3.set_namespace('http://testBuildPlanning.org')

assert validate_composite_part_assemblies(assemble_BBa_K093005(test_doc))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explain why these should or shouldn't work in comments

assert not validate_composite_part_assemblies(assemble_BBa_K093005(test_doc, 'EXTRA_ASSEMBLY_COMPONENT'))

def assemble_BBa_K093005(doc: sbol3.Document, failure_mode: Optional[str] = ''):
doc = sbol3.Document()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above; need comments to explain your testing

…plan. Also modified part in backbone validation to use is_plasmid helper function and check if component contains a single insert and a single backbone.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validation of assembly-plan
2 participants